<script setup>
import { routes } from "@/router";
import router from "./router";
import keepAliveStore from "@/store/modules/keepalive";
const keepStore = keepAliveStore();

// const keepAliveRef = ref()
// const navigateToNewRoute = (path) => {
//   router.replace('/task/develop');
//   nextTick(() => {
//     // 清除特定的缓存组件
//     if (keepAliveRef.value && keepAliveRef.value.vnode) {
//       keepAliveRef.value.vnode.componentInstance = null;
//     }
//   });
// };
// export { navigateToNewRoute };
</script>

<template>
  <!-- 在 qiankun 环境中不显示菜单 -->
  <!-- <div v-if="!qiankunWindow.__POWERED_BY_QIANKUN__" class="flex my-2 justify-center gap-2">
    <div v-for="(item, index) in routes" :key="index" class="hover:text-blue-500">
      <router-link :to="item.path">{{ item.meta.title || item.name }}</router-link>
    </div>
  </div> -->
  <router-view v-slot="{ Component }">
    <keep-alive :include="keepStore.keepAliveList">
      <component :is="Component" ref="keepAliveRef" />
    </keep-alive>
  </router-view>
</template>

<style></style>
